package com.aivin.dao;

import com.aivin.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Created by Administrator on 2016/8/22.
 */
public interface IPicDao {

    /**
     * 根据偏移量查找全部信息 。 分页查询
     * @return
     */
   public   List<TbPic> queryAllPicFy(@Param( "offset") int offset  , @Param("limit") int limit) ;

    public   List<TbPic> queryAllPicFyByUserId( @Param( "userId") int  userId , @Param( "offset") int offset  , @Param("limit") int limit) ;


    public   List<TbPic>  getPicResultBydKeyWorldFy(  @Param( "keyWord") String  keyWord , @Param( "offset")  int offset  , @Param( "limit") int  limit);
    public   List<TbUser>  getUserResultBydKeyWorldFy(@Param( "keyWord") String  keyWord , @Param( "offset")  int offset  , @Param( "limit") int  limit);

    public int getPicRecodeSize(@Param( "keyWord") String  keyWord);
    public int getUserRecodeSize(@Param( "keyWord") String  keyWord);

    public int getAllPicSizeByUserId(@Param( "userId") int userId);
    public int getPiclikeCountByPicId (@PathVariable int picId    );
    public int getiiclikedStateByPicIdAndUserId (@PathVariable int picId   ,@PathVariable int userId    );

    public PiclikedtableBean getPicLikedStateByUser(@PathVariable int picId   ,@PathVariable int userId  );
    public int setPicLikedStateByUser(@PathVariable int likestate  ,@PathVariable int picId   ,@PathVariable int userId  );

   public int  publishPic (@PathVariable TbPic picBean );

    public int   addPicLikedStateByUserId(@PathVariable PiclikedBean  bean );

    /**get some picInfo recoomend by system**/
    public List<RecommendInfoBean> getRecommendPics(  );

   /**用户点赞列表、用户图片收藏列表**/
   public List<PiclikedtableBean> queryPicLikedListByUserId(@PathVariable int userId ,@PathVariable int offset  ,@PathVariable int limit );
   /**根据图片id获取图片信息**/
   public TbPic queryPicInfoByPicId(@PathVariable int picId);

}
